package com.neusoft.mapper;

import com.neusoft.core.PointLog;
import org.apache.ibatis.annotations.*;

import java.util.List;

@Mapper
public interface PointLogMapper {
    // 增
    @Insert("INSERT INTO point_log(userId, `change`, reason) VALUES(#{userId}, #{change}, #{reason})")
    int addPointLog(PointLog pointLog);

    // 删
    @Delete("DELETE FROM point_log WHERE logId = #{logId}")
    int deletePointLogById(Integer logId);

    // 查
    @Select("SELECT * FROM point_log WHERE logId = #{logId}")
    PointLog getPointLogById(Integer logId);

    @Select("SELECT * FROM point_log WHERE userId = #{userId}")
    List<PointLog> getAllPointLogsByUserId(String userId);
}
